<template>
  <view :style="themeColor">
    <view class="page">
      <fu-custom :isBack="true" :isBottom="true" bgColor="bg-white">
        <view slot="content">{{scriptures.title}}</view>
      </fu-custom>
      <!--    <view class="flex benben-position-layout flex flex-wrap align-center introductionScriptures_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub introductionScriptures_fd0_0'>
          <view class='flex flex-wrap align-center introductionScriptures_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <text class='fu-iconfont2  introductionScriptures_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='text-cut flex flex-wrap align-stretch justify-center' style="width: 200rpx;">{{scriptures.title}}
          </view>
          <view class='flex flex-wrap align-center justify-end introductionScriptures_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view> -->
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout introductionScriptures_flex_1">
        <view class='flex flex-wrap align-start introductionScriptures_fd1_0'>
          <image class='introductionScriptures_fd1_0_c0' mode="aspectFill" :src='scriptures.img'></image>
          <view class='flex flex-direction flex-wrap align-start'>
            <text class='introductionScriptures_fd1_0_c1_c0'>{{scriptures.title}}</text>
            <view class='flex flex-wrap align-center introductionScriptures_fd1_0_c1_c1'>
              <text class='introductionScriptures_fd1_0_c1_c1_c0'>{{$t('修习人数：')}}</text>
              <text class='introductionScriptures_fd1_0_c1_c1_c0'>{{scriptures.num}}</text>
              <text class='introductionScriptures_fd1_0_c1_c1_c0'>{{$t('人')}}</text>
            </view>
          </view>
        </view>
        <view class='flex flex-wrap align-center introductionScriptures_fd1_1'>
          <text class='introductionScriptures_fd1_1_c0'>{{$t('简介')}}</text>
        </view>
        <view class='flex flex-wrap align-center introductionScriptures_fd1_1'>
          <jyf-parser :html="scriptures.text | richTextFormat"></jyf-parser>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <view
        class="flex flex-direction flex-wrap align-stretch benben-position-layout flex introductionScriptures_flex_2">
        <view class='flex flex-wrap align-center justify-between flex-sub introductionScriptures_fd2_0'>
          <button class='introductionScriptures_fd2_0_c0' v-if="scriptures.is_check==0"
            @click.stop="addBook">{{$t('添加书签')}}</button>
          <button class='introductionScriptures_fd2_0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo"
            :data-url="`/pages/fyql/startPracticing/startPracticing?id=${scriptures.aid}&name=${scriptures.title}`">{{$t('开始修持')}}</button>
        </view>

      </view>
      <view :style="{height: '140rpx'}"></view>


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},


    data() {
      return {
        "scriptures": {
          "title": "",
          "img": "",
          "num": "",
          "text": "",
          "aid": "",
          "create_time": ""
        },
        "id": ""
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        id
      } = options
      if (id !== undefined) this.id = id
      this.getScripturesFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      addBook() {

        this.$api.get(global.apiUrls.post65715af8ebcca, {
          aid: this.id,
          book_id: this.id
        }).then(res => {
          if (res.data.code == 1) {
            this.$message.info(res.data.msg)
            this.getScripturesFunc()
          }
        })
      },
      //获取经文介绍
      async getScripturesFunc() {
        //请求方法
        //数据验证

        let datascriptures = await this.$api.get(global.apiUrls.post657158fb22578, {
          aid: this.id
        });

        if (datascriptures.data.code != 1) {
          this.$message.info(datascriptures.data.msg);
          return
        }
        let infoscriptures = datascriptures.data;
        this.scriptures = infoscriptures.data

      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(247, 243, 237, 1);
    background-size: 100% auto;
  }

  .introductionScriptures_flex_0 {
    border-bottom: 1px solid #eee;
    background: rgba(247, 243, 237, 1);
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .introductionScriptures_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .introductionScriptures_fd0_0_c0 {
    width: 120rpx;
  }

  .introductionScriptures_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .introductionScriptures_flex_1 {
    padding: 32rpx 32rpx 0rpx 32rpx;
  }

  .introductionScriptures_fd1_2_c0 {
    color: #666666;
    font-size: 28rpx;
    font-weight: 400;
    line-height: 46rpx;
    text-indent: 2em;
  }

  .introductionScriptures_fd1_1_c0 {
    color: #333333;
    font-size: 32rpx;
    font-weight: 500;
    line-height: 54rpx;
  }

  .introductionScriptures_fd1_1 {
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .introductionScriptures_fd1_0_c1_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    line-height: 36rpx;
  }

  .introductionScriptures_fd1_0_c1_c1 {
    margin: 24rpx 0rpx 0rpx 0rpx;
  }

  .introductionScriptures_fd1_0_c1_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    line-height: 42rpx;
  }

  .introductionScriptures_fd1_0_c0 {
    width: 176rpx;
    height: 216rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 20rpx 0rpx 0rpx;
  }

  .introductionScriptures_fd1_0 {
    background: rgba(255, 255, 255, 1);
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 32rpx;
  }

  .introductionScriptures_flex_2 {
    background: rgba(235, 228, 217, 1);
    width: 750rpx;
    height: 140rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    background-size: 100% auto;
  }

  .introductionScriptures_fd2_0_c1 {
    background: rgba(145, 47, 34, 1);
    border-radius: 44rpx;
    width: 332rpx;
    line-height: 80rpx;
    font-size: 32rpx;
    color: #fff;
  }

  .introductionScriptures_fd2_0_c0 {
    background: rgba(152, 112, 64, 1);
    border-radius: 44rpx;
    width: 332rpx;
    line-height: 80rpx;
    font-size: 32rpx;
    color: #fff;
  }

  .introductionScriptures_fd2_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }
</style>
